package com.eastidea.live.entity;

// Generated Feb 8, 2013 11:13:15 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.SEQUENCE;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * AppApplication generated by hbm2java
 */
@Entity
@Table(name = "app_application", schema = "public")
public class AppApplication implements java.io.Serializable {

	private Long id;
	private AppCompany appCompany;
	private String name;
	private String descr;
	private String runQrCode;
	private int status;
	private Set<FrmUiForm> frmUiForms = new HashSet<FrmUiForm>(0);

	public AppApplication() {
	}

	public AppApplication(AppCompany appCompany, String name, int status) {
		this.appCompany = appCompany;
		this.name = name;
		this.status = status;
	}

	public AppApplication(AppCompany appCompany, String name, String descr,
			int status, Set<FrmUiForm> frmUiForms) {
		this.appCompany = appCompany;
		this.name = name;
		this.descr = descr;
		this.status = status;
		this.frmUiForms = frmUiForms;
	}

	@SequenceGenerator(name = "generator", sequenceName = "app_application_seq")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "company_id", nullable = false)
	public AppCompany getAppCompany() {
		return this.appCompany;
	}

	public void setAppCompany(AppCompany appCompany) {
		this.appCompany = appCompany;
	}

	@Column(name = "name", nullable = false, length = 500)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "descr", length = 1000)
	public String getDescr() {
		return descr;
	}

	public void setDescr(String descr) {
		this.descr = descr;
	}

	@Column(name = "status", nullable = false)
	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "appApplication")
	public Set<FrmUiForm> getFrmUiForms() {
		return this.frmUiForms;
	}

	public void setFrmUiForms(Set<FrmUiForm> frmUiForms) {
		this.frmUiForms = frmUiForms;
	}

	@Column(name = "run_qr_code", length = 1000)
	public String getRunQrCode() {
		return runQrCode;
	}
	public void setRunQrCode(String runQrCode) {
		this.runQrCode = runQrCode;
	}

}
